package awd.bj.jls.webs.api.hystrix;

import java.util.Map;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;

import awd.bj.jls.webs.api.JlsAnalyseApi;
import awd.bj.jls.webs.utils.ResponseMessage;
import feign.hystrix.FallbackFactory;


@Component
public class JlsAnalyseApiFallBackFactory implements FallbackFactory<JlsAnalyseApi> {
    public static Logger logger = Logger.getLogger(JlsAnalyseApi.class);

    @Override
    public JlsAnalyseApi create(Throwable throwable) {
        return new JlsAnalyseApi() {
            @Override
            public ResponseMessage<Map<String, Object>> jbdj(Map<String,Object> map) {
                throwable.printStackTrace();
                logger.info("进入熔断器=======>>" + Thread.currentThread().getStackTrace()[1].getMethodName() + "方法执行出错");
                return ResponseMessage.error("查询出错！");
            }
            
        };
    }
}
